<script type="text/javascript">
  // Date picker initialized on this page.
	$(document).ready(function() {
		$( "#datepicker" ).datepicker(
				{dateFormat: 'yy-mm-dd'}
		);
	});
</script>
<div class="add-trans-container form-container pull-left">
<?php
// Loading the form and html helper.
$this->load->helper('form');
$this->load->helper('html');

// Building the array for the drop down for expense category.
$category = array();
$category['0'] = 'SELECT';
$category_array = $this->global_model->global_get_categories('expense');

// Populating the $category array with the query result.
foreach ($category_array as $value) {
	$category[$value['cid']] = $value['name'];
}

print form_open('transactions/do_add');

print form_label('Transaction date:');
print form_input('date','','id="datepicker" placeholder="DD/MM/YY"');

print form_label('Particulars:');
print form_input('particulars','','placeholder="Enter the description"');

print form_label('Transaction Amount:');
print form_input('amount','', 'placeholder="Enter the total amount"');

print form_label('Select a category:');
print form_dropdown('category',$category,'','id="category-selector"');
?>

<div id="sub-cat-holder"></div>

<?php
print br();
print form_submit('save', 'Save', 'class="btn btn-large btn-success"');
print nbs(4);
print form_reset('reset','Clear', 'class="btn btn-large btn-primary');

print form_close();
?>
</div>